from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager

db = SQLAlchemy()


login_manager = LoginManager()

@login_manager.user_loader
def load_user(user_id):
    """登陆表单用

    """
    from .models import Admin
    user = Admin.query.get(int(user_id))
    return user